package com.itheima.web;

import com.itheima.bean.Setmeal;
import com.itheima.common.R;
import com.itheima.service.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 类说明：
 *
 * @ClassName SetmealController
 * @Author Zheng
 * @Date 2022/9/4 22:20
 * @Version 1.0
 */
@RestController
@RequestMapping("/setmeal")
public class SetmealController {

    @Autowired
    private SetmealService setmealService;

    @GetMapping("/list")
    public R findByCategoryId(Long categoryId, Integer status){

        List<Setmeal> setmealList = setmealService.findByCategoryId(categoryId, status);
        return R.success(setmealList);
    }

}
